package com.ml.mall.mapper.credit;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ml.mall.bean.req.credit.CreditRecordQueryDto;
import com.ml.mall.bean.res.credit.CreditRecordQueryRes;
import com.ml.mall.entity.credit.SysCreditRecord;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.math.BigDecimal;
import java.util.List;

@Repository
@Mapper
public interface SysCreditRecordMapper extends BaseMapper<SysCreditRecord> {
    /**
     * @description    :分页查询余额变更记录
     * @author         :zxm
     * @date           :2021/5/19
    **/
    List<CreditRecordQueryRes> selectPageCreditRecord(@Param("dto")CreditRecordQueryDto dto);

    /**
     * @description    :汇总余额
     * @author         :zxm
     * @date           :2021/5/19
    **/
    BigDecimal sumCreditRecordMoney(@Param("dto")CreditRecordQueryDto dto);

    /**
     * @description    :汇总分页查询总记录数
     * @author         :zxm
     * @date           :2021/5/19
    **/
    Long selectCountCreditRecord(@Param("dto") CreditRecordQueryDto dto);
}